package com.hksj.umm.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hksj.common.core.model.Rest;
import com.hksj.umm.query.UVDeviceRecordCountQuery;
import com.hksj.umm.query.UVDeviceRecordQuery;
import com.hksj.umm.service.UVDeviceService;
import com.hksj.umm.vo.UVDeviceRecordCountVO;
import com.hksj.umm.vo.UVDeviceRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "紫外线灯-设备列表")
@RestController
@RequestMapping("/api/umm/device")
public class UVDeviceController {

    @Autowired
    private UVDeviceService uvDeviceService;

    @PostMapping("/queryUVDeviceWorkRecord")
    @ApiOperation(value = "查询设备消杀记录",response = UVDeviceRecordVO.class)
    public Rest<IPage<UVDeviceRecordVO>> queryUVDeviceWorkRecord(@RequestBody UVDeviceRecordQuery query){
        return Rest.ok(uvDeviceService.queryUVDeviceWorkRecord(query));
    }

    @PostMapping("/queryUVDeviceWorkRecordCount")
    @ApiOperation(value = "查询消杀次数统计",response = UVDeviceRecordCountVO.class)
    public Rest<IPage<UVDeviceRecordCountVO>> queryUVDeviceWorkCount(@RequestBody UVDeviceRecordCountQuery query){
        return Rest.ok(uvDeviceService.queryUVDeviceWorkCount(query));
    }

}
